package com.jeecg.struts.business;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import com.jeecg.struts.action.Action;
import com.jeecg.struts.form.ActionForm;
import com.jeecg.struts.form.RegisterForm;

public class RegisterAction  implements Action {

	
	@Override
	public String execute(HttpServletRequest req,ActionForm actionForm,Map<String,String> forwordMap) {
		RegisterForm regForm = (RegisterForm)actionForm;
		String username = regForm.getUsername();
		String password = regForm.getPassword();
		String email = regForm.getEmail();
		String age = regForm.getAge();
		if(!username.equals("")&&!password.equals("")&&!email.equals("")&&!age.equals("")){
			 req.setAttribute("form", actionForm);
			 return forwordMap.get("success") ;
		}
		req.setAttribute("ErrorMsg", "value is empty");
		return  forwordMap.get("fail") ;
	}
	

}
